﻿using MengLin.OOP.DesignPattern.Implement.ThreeCountry.WeiGuo;
using MengLin.OOP.DesignPattern.Interface.ThreeCountry;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MengLin.OOP.DesignPattern.ThreeCountry.AbstractFactory
{
    /// <summary>
    /// 魏国工厂
    /// 封装转移
    /// 把对象的创建交给第三方创建
    /// 每一个工厂负责多个不同类型的对象的创建
    /// 应用场景：a.创建一组对象.b.且一组对象的多个版本
    /// 倾斜的可扩展设计：(产品簇)(创建一组产品很方便)
    /// </summary>
    public class WeilGuoFactory : AbstractFactory
    {
        /// <summary>
        /// 创建魏国主公
        /// </summary>
        /// <returns></returns>
        public override IZhuGong CreateZhuGong()
        {
            return new WeiGuoZhuGong();
        }

        /// <summary>
        ///  创建魏国武将
        /// </summary>
        /// <returns></returns>
        public override IWuJiang CreateWuJiang()
        {
            return new WeiGuoWuJiang();
        }
    }
}
